home *** CD-ROM | disk | FTP | other *** search
- CHG 2.0
-
- A Program to Change
- File Attributes, Dates, and Times
-
- by
- Bob Eyer
- [73230,2620]
-
- Nov 11, 1990
-
-
- Syntax:
-
- CHG [filename/wildcard] [option-string]
-
- The option-string may be:
- - an attribute or combination thereof
- - a date
- - a time
- (see discussion below)
-
- Comments on Filename/wildcard:
- ------------------------------
- - The filename or wildcard argument may either have no drive or
- path specifiers or may be fully pathed, as in a filespec. With no
- path or drive information, CHG assumes the default drive and path.
-
- However, if the user wishes to change all files in the default
- path, he must either use
-
- CHG *.* option-string
-
- or
-
- CHG . option-string
-
- NEW FEATURE:
- -----------
- CHG also supports normal DOS shortcuts, such as "..\." and
- "..\XYZ\." in place of the usual format for wildcards.
-
-
-
- Comments on the option-string
- -----------------------------
- There are three mutually exclusive types of option-strings:
-
- 1) Attribute-setting option strings.
- ---------------------------------
- These must contain the letters R, H, S, A, or X in any
- combination or order with no other imbedded characters. For
- example,
-
- CHG XYZ R
-
- changes file XYZ to Read only. Another example:
-
- CHG *.SYS RHSA
- or
- CHG *.SYS SHRA
-
- changes all '.SYS' files in the default directory to Read
- only Hidden System Archive. Another example:
-
- CHG \SYS\*.DOC X
-
- resets the attributes of all DOC files in the SYS directory
- on the default drive.
-
- No special parameter marker, such as a dash or a slash, is
- needed to show that such option strings are indeed
- attributes. This fact makes CHG easier to use than ATTRIB.
-
- CHG, unlike ATTRIB, will accept dashes or underscores in
- filenames or wildcards with no difficulty. This is related
- to the fact that no dashes are used to identify attribute
- options.
-
- What happens if no option string is mentioned:
- ---------------------------------------------
- CHG will simply provide a complete report of everything that
- it can change on each file selected (the date, time, and
- attribute), if no option-string is mentioned. In contrast,
- ATTRIB will only report the attributes of the files in
- question.
-
-
- 2) Date-setting option-strings.
- ---------------------------
- If you wish to change the date of a file or series of files
- determined by a wildcard mask, just use your desired date as
- your option-string. Thus,
-
- CHG RENAME.COM 2/1/89
-
- will change the date stamp of RENAME.COM to 02-01-1989
- without changing the time stamp or the attribute. Here,
- slashes in the date parameter are mandatory (this is how CHG
- recognises your option-string as a date).
-
- You may also use the complete form. Thus:
-
- CHG RENAME.COM 02/01/1989, or
-
- CHG RENAME.COM 02/01/89
-
- will also redate RENAME.COM to 02-01-1989.
-
- A new and useful feature:
- -------------------------
- If you use TO/DAY as your option-string, CHG will change your
- file(s) to the current DOS date in your computer. Thus, if
- today is 11-11-90, then
-
- CHG BREAK.TXT to/day
-
- will change the date stamp of BREAK.TXT to 11-11-1990.
-
- Caveat:
- If you attempt to change the date/time stamp of a readonly
- file, no date/time stamp change will occur. You can see the
- effect of this by watching the report display on a mix of
- read only and archive (or reset) files.
-
- 3) Time-setting option strings.
- ---------------------------
- Here, CHG uses the colon (':') to recognise your option
- string as a time. CHG updates the time-stamp of a file to
- one-minute precision. For example,
-
- CHG ABC.EXE 5:40
-
- will change the time-stamp of ABC.EXE to 05:40 A.M.
-
- CHG ABC.EXE 14:20
-
- will change the time-stamp to 2:20 P.M.
-
- A new feature:
- -------------
- If you use RIGHT:NOW as your option string, CHG will use the
- current time in DOS as the parameter to use for time-stamping
- your file. For example, if it is now 4:31 P.M., executing
-
- CHG *.EXE right:now
-
- will change the time-stamp of all EXE files in the default
- directory to 4:31 P.M. (16:31 hours).
-
- Caveat:
- If you attempt to change the date/time stamp of a readonly
- file, no date/time stamp change will occur. You can see the
- effect of this by watching the report display on a mix of
- read only and archive (or reset) files.
-
- Use of CHG to read file information
- -----------------------------------
- As stated previously, CHG displays the current values of all
- variables it can change if executed without the option-string.
- For example,
-
- CHG *.EXE
-
- will present a list of all EXE files in the default directory,
- listing the date/time stamp, as well as the DOS attribute number
- (decimal) and a description of the attribute(s).
-
- Users may contact me at Compuserve through userid [73230,2620].
-
- DISCLAIMER:
- ==========
- This program is circulated as public domain without any guarantee
- or warranty; and the user, by downloading this program, or any
- variant thereof or by receiving it or any of its versions in any
- other form, agrees to accept full responsibility for its use. It
- is therefore understood that the user accepts this program or any
- previous version as is.
-
- -------------------------------------------------------------
- End of documentation.